/*
* @Author: Active code page: 65001
lvhang
* @Date:   2020-11-11 17:02:32
* @Last Modified by:   Active code page: 65001
lvhang
lvhang
lvhang
lvhang
lvhang
lvhang
lvhang
lvhang
lvhang
lvhang
lvhang
lvhang
lvhang
lvhang
lvhang
lvhang
lvhang
lvhang
lvhang
* @Last Modified time: 2020-11-11 17:31:25
*/

const fs = require('fs');

// 涉及到了 路径拼接 就要引入 path 模块
const path = require('path');

// readFile API 起作用的范围就是 当前命令行的工作目录！
fs.readFile(path.join(__dirname, 'lvhang.txt'), 'utf-8', function(err, doc) {
    // console.log(err);
    console.log(doc);
    // path.join(__dirname) 这个函数的作用是 拿到当前 文件的绝对路径
    // D:\myProfessionalProfiles\QDSJK\Node\newTest
    console.log(path.join(__dirname));
    console.log(path.join(__dirname, 'lvhang.txt'));
})